package com.jinyuanchun.learnjava.mapper;

import com.jinyuanchun.learnjava.dao.PmsProject;
import com.jinyuanchun.learnjava.mapper.provider.PmsProjectProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import java.util.List;
import java.util.Map;

public interface PmsProjectMapper {
    int deleteByPrimaryKey(String subprojectId);

    int insert(PmsProject record);

    int insertSelective(PmsProject record);

    PmsProject selectByPrimaryKey(String subprojectId);

    int updateByPrimaryKeySelective(PmsProject record);

    int updateByPrimaryKey(PmsProject record);

    @SelectProvider(type = PmsProjectProvider.class,method = "existsInList")
    @MapKey("subprojectId")
    Map<String,PmsProject> existInList(List<String> subs);

    @InsertProvider(type = PmsProjectProvider.class,method = "insertBatch")
    int insertBatch(List<PmsProject> pmsProjects);

    @UpdateProvider(type = PmsProjectProvider.class,method = "updateBatch")
    int updateBatch(List<PmsProject> pmsProjects);

}